.class public Les/ha;
.super Lcom/esfile/screen/recorder/media/glutils/a;
.source "GifEditSurface.java"


# instance fields
.field private o:I

.field private p:I

.field private q:I

.field private r:I

.field private s:Les/j8;

.field private t:Les/u7;

.field private u:Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;

.field private v:Z

.field private w:Landroid/graphics/RectF;

.field private x:Ljava/lang/Boolean;

.field private y:Landroid/graphics/Rect;

.field private z:Landroid/graphics/Rect;


# direct methods
.method public constructor <init>(IIIIZ)V
    .locals 0

    .line 1
    invoke-direct {p0, p1, p2, p5}, Lcom/esfile/screen/recorder/media/glutils/a;-><init>(IIZ)V

    .line 2
    sget-object p5, Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;->FIT_XY:Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;

    iput-object p5, p0, Les/ha;->u:Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;

    const/4 p5, 0x0

    .line 3
    iput-object p5, p0, Les/ha;->w:Landroid/graphics/RectF;

    .line 4
    new-instance p5, Landroid/graphics/Rect;

    invoke-direct {p5}, Landroid/graphics/Rect;-><init>()V

    iput-object p5, p0, Les/ha;->z:Landroid/graphics/Rect;

    .line 5
    iput p1, p0, Les/ha;->o:I

    .line 6
    iput p2, p0, Les/ha;->p:I

    .line 7
    iput p3, p0, Les/ha;->q:I

    .line 8
    iput p4, p0, Les/ha;->r:I

    .line 9
    invoke-direct {p0}, Les/ha;->h()V

    .line 10
    invoke-virtual {p0, p3, p4}, Lcom/esfile/screen/recorder/media/glutils/a;->b(II)V

    return-void
.end method

.method private h()V
    .locals 10

    .line 1
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/media/glutils/a;->b()I

    move-result v0

    div-int/lit8 v0, v0, 0x5a

    rem-int/lit8 v0, v0, 0x2

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    if-eqz v0, :cond_1

    .line 2
    iget v1, p0, Les/ha;->r:I

    goto :goto_1

    :cond_1
    iget v1, p0, Les/ha;->q:I

    :goto_1
    if-eqz v0, :cond_2

    .line 3
    iget v0, p0, Les/ha;->q:I

    goto :goto_2

    :cond_2
    iget v0, p0, Les/ha;->r:I

    .line 4
    :goto_2
    iget-object v2, p0, Les/ha;->w:Landroid/graphics/RectF;

    const-string v3, "EditSurface"

    if-eqz v2, :cond_4

    invoke-virtual {v2}, Landroid/graphics/RectF;->width()F

    move-result v2

    const/4 v4, 0x0

    cmpl-float v2, v2, v4

    if-lez v2, :cond_4

    iget-object v2, p0, Les/ha;->w:Landroid/graphics/RectF;

    invoke-virtual {v2}, Landroid/graphics/RectF;->height()F

    move-result v2

    cmpl-float v2, v2, v4

    if-lez v2, :cond_4

    .line 5
    iget-object v2, p0, Les/ha;->w:Landroid/graphics/RectF;

    .line 6
    iget-boolean v4, p0, Les/ha;->v:Z

    if-eqz v4, :cond_3

    .line 7
    new-instance v4, Landroid/graphics/RectF;

    iget v5, v2, Landroid/graphics/RectF;->left:F

    int-to-float v6, v1

    mul-float v5, v5, v6

    iget v7, v2, Landroid/graphics/RectF;->top:F

    int-to-float v8, v0

    mul-float v7, v7, v8

    iget v9, v2, Landroid/graphics/RectF;->right:F

    mul-float v9, v9, v6

    iget v2, v2, Landroid/graphics/RectF;->bottom:F

    mul-float v2, v2, v8

    invoke-direct {v4, v5, v7, v9, v2}, Landroid/graphics/RectF;-><init>(FFFF)V

    move-object v2, v4

    .line 8
    :cond_3
    iget v4, p0, Les/ha;->o:I

    iget v5, p0, Les/ha;->p:I

    .line 9
    invoke-virtual {v2}, Landroid/graphics/RectF;->width()F

    move-result v6

    float-to-int v6, v6

    invoke-virtual {v2}, Landroid/graphics/RectF;->height()F

    move-result v7

    float-to-int v7, v7

    iget-object v8, p0, Les/ha;->u:Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;

    .line 10
    invoke-static {v4, v5, v6, v7, v8}, Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil;->a(IIIILcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;)Landroid/graphics/Rect;

    move-result-object v4

    .line 11
    iput-object v4, p0, Les/ha;->y:Landroid/graphics/Rect;

    .line 12
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "video crop rect:"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v6, p0, Les/ha;->y:Landroid/graphics/Rect;

    invoke-virtual {v6}, Landroid/graphics/Rect;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v3, v5}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 13
    invoke-virtual {v4}, Landroid/graphics/Rect;->width()I

    move-result v5

    int-to-float v5, v5

    const/high16 v6, 0x3f800000    # 1.0f

    mul-float v5, v5, v6

    invoke-virtual {v2}, Landroid/graphics/RectF;->width()F

    move-result v7

    div-float/2addr v5, v7

    .line 14
    invoke-virtual {v4}, Landroid/graphics/Rect;->height()I

    move-result v7

    int-to-float v7, v7

    mul-float v7, v7, v6

    invoke-virtual {v2}, Landroid/graphics/RectF;->height()F

    move-result v6

    div-float/2addr v7, v6

    .line 15
    iget-object v6, p0, Les/ha;->z:Landroid/graphics/Rect;

    iget v8, v4, Landroid/graphics/Rect;->left:I

    int-to-float v8, v8

    iget v9, v2, Landroid/graphics/RectF;->left:F

    mul-float v9, v9, v5

    sub-float/2addr v8, v9

    float-to-int v8, v8

    iput v8, v6, Landroid/graphics/Rect;->left:I

    int-to-float v8, v8

    int-to-float v1, v1

    mul-float v1, v1, v5

    add-float/2addr v8, v1

    float-to-int v1, v8

    .line 16
    iput v1, v6, Landroid/graphics/Rect;->right:I

    .line 17
    iget v1, v4, Landroid/graphics/Rect;->top:I

    int-to-float v1, v1

    iget v2, v2, Landroid/graphics/RectF;->top:F

    mul-float v2, v2, v7

    sub-float/2addr v1, v2

    float-to-int v1, v1

    iput v1, v6, Landroid/graphics/Rect;->top:I

    int-to-float v1, v1

    int-to-float v0, v0

    mul-float v0, v0, v7

    add-float/2addr v1, v0

    float-to-int v0, v1

    .line 18
    iput v0, v6, Landroid/graphics/Rect;->bottom:I

    goto :goto_3

    :cond_4
    const/4 v2, 0x0

    .line 19
    iput-object v2, p0, Les/ha;->y:Landroid/graphics/Rect;

    .line 20
    iget v2, p0, Les/ha;->o:I

    iget v4, p0, Les/ha;->p:I

    iget-object v5, p0, Les/ha;->u:Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;

    invoke-static {v2, v4, v1, v0, v5}, Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil;->a(IIIILcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;)Landroid/graphics/Rect;

    move-result-object v0

    iput-object v0, p0, Les/ha;->z:Landroid/graphics/Rect;

    .line 21
    :goto_3
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "video draw rect:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v1, p0, Les/ha;->z:Landroid/graphics/Rect;

    invoke-virtual {v1}, Landroid/graphics/Rect;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v3, v0}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method


# virtual methods
.method public a(I)V
    .locals 0

    .line 14
    invoke-super {p0, p1}, Lcom/esfile/screen/recorder/media/glutils/a;->a(I)V

    .line 15
    invoke-direct {p0}, Les/ha;->h()V

    return-void
.end method

.method public a(Landroid/graphics/RectF;Z)V
    .locals 2

    if-eqz p1, :cond_0

    .line 9
    invoke-virtual {p1}, Landroid/graphics/RectF;->width()F

    move-result v0

    const/4 v1, 0x0

    cmpl-float v0, v0, v1

    if-lez v0, :cond_0

    invoke-virtual {p1}, Landroid/graphics/RectF;->height()F

    move-result v0

    cmpl-float v0, v0, v1

    if-lez v0, :cond_0

    .line 10
    iput-boolean p2, p0, Les/ha;->v:Z

    .line 11
    iput-object p1, p0, Les/ha;->w:Landroid/graphics/RectF;

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    .line 12
    iput-object p1, p0, Les/ha;->w:Landroid/graphics/RectF;

    .line 13
    :goto_0
    invoke-direct {p0}, Les/ha;->h()V

    return-void
.end method

.method public a(Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;)V
    .locals 0
    .param p1    # Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 8
    iput-object p1, p0, Les/ha;->u:Lcom/esfile/screen/recorder/media/util/ScaleTypeUtil$ScaleType;

    return-void
.end method

.method public a(Les/f8;)V
    .locals 2

    .line 1
    iget-object v0, p0, Les/ha;->s:Les/j8;

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0}, Les/j8;->a()V

    const/4 v0, 0x0

    .line 3
    iput-object v0, p0, Les/ha;->s:Les/j8;

    :cond_0
    if-eqz p1, :cond_1

    .line 4
    new-instance v0, Les/j8;

    invoke-direct {v0, p1}, Les/j8;-><init>(Les/f8;)V

    iput-object v0, p0, Les/ha;->s:Les/j8;

    .line 5
    iget p1, p0, Les/ha;->o:I

    iget v1, p0, Les/ha;->p:I

    invoke-virtual {v0, p1, v1}, Les/j8;->a(II)V

    .line 6
    iget-object p1, p0, Les/ha;->x:Ljava/lang/Boolean;

    if-eqz p1, :cond_1

    .line 7
    iget-object v0, p0, Les/ha;->s:Les/j8;

    invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z

    move-result p1

    invoke-virtual {v0, p1}, Les/j8;->a(Z)V

    :cond_1
    return-void
.end method

.method public c(J)V
    .locals 3

    const/16 v0, 0xc11

    .line 1
    invoke-static {v0}, Landroid/opengl/GLES20;->glDisable(I)V

    .line 2
    iget v0, p0, Les/ha;->o:I

    iget v1, p0, Les/ha;->p:I

    const/4 v2, 0x0

    invoke-static {v2, v2, v0, v1}, Landroid/opengl/GLES20;->glViewport(IIII)V

    .line 3
    iget-object v0, p0, Les/ha;->s:Les/j8;

    if-eqz v0, :cond_0

    .line 4
    invoke-virtual {v0, p1, p2}, Les/j8;->a(J)V

    :cond_0
    return-void
.end method

.method public d(J)V
    .locals 2

    .line 1
    iget-object v0, p0, Les/ha;->t:Les/u7;

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0, p1, p2}, Les/u7;->a(J)I

    .line 3
    :cond_0
    iget-object p1, p0, Les/ha;->z:Landroid/graphics/Rect;

    iget p2, p1, Landroid/graphics/Rect;->left:I

    iget v0, p0, Les/ha;->p:I

    iget v1, p1, Landroid/graphics/Rect;->top:I

    sub-int/2addr v0, v1

    .line 4
    invoke-virtual {p1}, Landroid/graphics/Rect;->height()I

    move-result p1

    sub-int/2addr v0, p1

    iget-object p1, p0, Les/ha;->z:Landroid/graphics/Rect;

    .line 5
    invoke-virtual {p1}, Landroid/graphics/Rect;->width()I

    move-result p1

    iget-object v1, p0, Les/ha;->z:Landroid/graphics/Rect;

    .line 6
    invoke-virtual {v1}, Landroid/graphics/Rect;->height()I

    move-result v1

    .line 7
    invoke-static {p2, v0, p1, v1}, Landroid/opengl/GLES20;->glViewport(IIII)V

    .line 8
    iget-object p1, p0, Les/ha;->y:Landroid/graphics/Rect;

    if-eqz p1, :cond_1

    const/16 p1, 0xc11

    .line 9
    invoke-static {p1}, Landroid/opengl/GLES20;->glEnable(I)V

    .line 10
    iget-object p1, p0, Les/ha;->y:Landroid/graphics/Rect;

    iget p2, p1, Landroid/graphics/Rect;->left:I

    iget v0, p0, Les/ha;->p:I

    iget v1, p1, Landroid/graphics/Rect;->top:I

    sub-int/2addr v0, v1

    .line 11
    invoke-virtual {p1}, Landroid/graphics/Rect;->height()I

    move-result p1

    sub-int/2addr v0, p1

    iget-object p1, p0, Les/ha;->y:Landroid/graphics/Rect;

    .line 12
    invoke-virtual {p1}, Landroid/graphics/Rect;->width()I

    move-result p1

    iget-object v1, p0, Les/ha;->y:Landroid/graphics/Rect;

    .line 13
    invoke-virtual {v1}, Landroid/graphics/Rect;->height()I

    move-result v1

    .line 14
    invoke-static {p2, v0, p1, v1}, Landroid/opengl/GLES20;->glScissor(IIII)V

    :cond_1
    return-void
.end method

.method public e()V
    .locals 0

    .line 1
    invoke-super {p0}, Lcom/esfile/screen/recorder/media/glutils/a;->e()V

    return-void
.end method

.method public f()V
    .locals 2

    .line 1
    iget-object v0, p0, Les/ha;->s:Les/j8;

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0}, Les/j8;->a()V

    .line 3
    iput-object v1, p0, Les/ha;->s:Les/j8;

    .line 4
    :cond_0
    iget-object v0, p0, Les/ha;->t:Les/u7;

    if-eqz v0, :cond_1

    .line 5
    invoke-virtual {v0}, Les/u7;->a()V

    .line 6
    iput-object v1, p0, Les/ha;->t:Les/u7;

    :cond_1
    return-void
.end method
